package com.yobol.jgrowth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Web MVC Config
 *
 * @author yobol
 * @create 2018-04-02 0:19
 **/
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter{
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //将本地资源的绝对路径映射到Spring Boot的静态资源路径中，作为资源服务器
        registry.addResourceHandler("/public/image/**").addResourceLocations("file:D:\\Projects\\_Resource\\JGrowth\\User\\image\\");
        registry.addResourceHandler("/static/ckfinder/**").addResourceLocations("classpath:/static/ckfinder/");
    }
}